package com.bosssoft.trainee.mbg.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.List;

/**
 * @Author: wuxin
 * @Date: 2022/6/21
 * @Project: rbac
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class RoleVO {
    private Integer  id;
    @NotBlank(message = "角色名不能为空")
    @Length(max = 6,message = "角色名长度不得多于6个字符")
    @Pattern(regexp = "^((?![!@#$%^&*()<>{}\\[\\]|\\\\+_=\\-:\";',.?/`~]).){1,6}$",message = "角色名称不能包含特殊字符")
    private String name;
    @NotBlank(message = "角色代码不能为空")
    @Pattern(regexp = "^\\d{4}$",message = "角色代码格式不正确")
    private String code;
    private Integer companyId;
    @NotNull(message = "部门id不能为空")
    private Integer departmentId;
    private String note;
    @NotNull(message = "状态不能为空")
    private Integer state;
    private List<Integer> resources;
}
